import request from '@/utils/request'

// 查询卡入库管理记录列表
export function listSim(query) {
  return request({
    url: '/iot/sim/info/list',
    method: 'get',
    params: query
  })
}

// 查询卡入库管理记录详细
export function getSim(id) {
  return request({
    url: '/system/sim/inbound/' + id,
    method: 'get'
  })
}

// 新增卡入库管理记录
export function addSim(data) {
  return request({
    url: '/system/sim/inbound',
    method: 'post',
    data: data
  })
}

// 修改卡入库管理记录
export function updateSim(data) {
  return request({
    url: '/system/sim/inbound',
    method: 'put',
    data: data
  })
}

// 删除卡入库管理记录
export function delSim(id) {
  return request({
    url: '/system/sim/inbound/' + id,
    method: 'delete'
  })
}

//依据上级地方ID获取对应下级单位列表
export function getChildrenAreaListByParentAreaId(childrenAreaType, parentAreaId) {
  return request({
    url: '/system/area/list/order?type='+ childrenAreaType + '&parentId=' + parentAreaId,
    method: 'get'
  })
}

// 卡资费信息
export function getSimPriceList(query,queryType) {
  return request({
    url: `/api/sim/getTariff/${query}/${queryType}`,
    method: 'get',
  })
}
// 单卡本月套餐流量用量实时查询
export function getSimFlowList(query) {
  return request({
    url: `/api/sim/simDataMargin/${query}`,
    method: 'get',
  })
}
// 群组用量信息
export function getSimGroupFlowList(query) {
  return request({
    url: `/api/sim/simDataMarginGroup/${query}`,
    method: 'get',
  })
}

// 卡变更状态查询
export function getSimChangeStatusList(data) {
  return request({
    url: 'api/sim/query/statusChange',
    method: 'post',
    data
  })
}


// 单卡状态变更
export function getSimStatusChangeList(data) {
  return request({
    url: `/api/sim/statusChange`,
    method: 'post',
    data
  })
}


// 服务变更
export function getSimVoiceChangeList(data) {
  return request({
    url: `/api/sim/cardStopOpen`,
    method: 'post',
    data
  })
}

// 获取sim卡导入结果文件
export function getSimCardImportResultFile(jobId) {
  return request({
    url: `/api/sim/inbound/exportExists/` + jobId,
    method: 'get',
    data
  })
}


// 获取上一次单号
export function getSimCardLastOrderNo() {
  return request({
    url: `iot/sim/info/miS`,
    method: 'get',
  })
}

// 获取跳转数据
export function getSimCardJumpData(number) {
  return request({
    url: `/iot/sim/info/card/process/${number}`,
    method: 'get',
  })
}

export function exportImportByFileName(query) {
  return request({
    url: '/system/sim/inbound/exportImportByFileName',
    method: 'post',
    params: query
  })
}
export function getcardwarehousing(){
  return request({
    url: '/iot/sim/info/operator',
    method: 'get',
  })

}